package com.glela.platform.mapper;

import org.apache.ibatis.annotations.Param;

import com.glela.platform.model.Token;

public interface TokenMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Token record);

    int insertSelective(Token record);

    Token selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Token record);

    int updateByPrimaryKey(Token record);
    /**
     * 根据用户id查询token
     * @return 
     */
	Token selectByUserId(@Param("userId") Long userId, @Param("clientType") String clientType);

	int deleteByLogOut(@Param("userId") Long userId, @Param("clientType") String clientType);

	/**
	 * 根据token查询是否有该数据
	 * @param header
	 * @return
	 */
	Token selectToken(Token record);

	Token selectTokenByCode(@Param("code") String code, @Param("clientType") String clientType);
}